package com.zisuyi.game.sdk.utils

import com.weilele.mvvm.base.helper.createStatusLiveData
import com.weilele.mvvm.base.helper.data
import com.weilele.mvvm.utils.activity.getUtdId
import com.zisuyi.game.sdk.net.bean.UserAssetsBean
import com.zisuyi.game.sdk.net.bean.UserInfoBean

object UserData {
    /**
     * 保存登录之后的用户信息
     */
    var userInfo: UserInfoBean? = null

    /**
     * 当前钻石数
     */
    val diamond: Long
        get() = userAssetsData.data?.diamond ?: 0L

    /**
     * 用户资产
     */
    val userAssetsData by lazy { createStatusLiveData<UserAssetsBean>() }

    /**
     * 用户id
     */
    var uid: String? = null
        get() {
            return field ?: getUtdId()
        }
}